package com.aggregate.pay.pufa;

import com.aggregate.pay.pufa.bean.PayReqBodyData;
import com.aggregate.pay.pufa.bean.PayResBodyData;
import com.aggregate.pay.pufa.bean.QueryReqBodyData;
import com.aggregate.pay.pufa.bean.QueryResBodyData;
import com.aggregate.pay.pufa.support.Client;
import com.aggregate.pay.pufa.support.Config;
import com.aggregate.pay.pufa.support.Factory;
import com.aggregate.pay.pufa.support.HttpClient;
import com.aggregate.pay.pufa.support.Merch;
import com.aggregate.pay.pufa.support.client.PayOrder;
import com.aggregate.pay.pufa.support.client.PayQuery;

/**
 * 浦发代付接口工具类，相关配置和接口调用从此类开始
 * @author Moyq5
 * @date 2019年1月3日
 */
public abstract class PufaApiFactory {

	public static void config(Config config, HttpClient httpClient) {
		Factory.setConfig(config);
		Factory.setHttpClient(httpClient);
	}

	@SuppressWarnings("unchecked")
	public static Client<PayReqBodyData, PayResBodyData> payOrderClient(Merch merch) {
		return (Client<PayReqBodyData, PayResBodyData>)Factory.getClient(PayOrder.class, merch);
	}

	@SuppressWarnings("unchecked")
	public static Client<QueryReqBodyData, QueryResBodyData> payQueryClient(Merch merch) {
		return (Client<QueryReqBodyData, QueryResBodyData>)Factory.getClient(PayQuery.class, merch);
	}

}
